/*
 * ParamElement.h
 *
 *  Created on: 2010-6-7
 *      Author: Guobc
 */

#ifndef PARAMELEMENT_H_
#define PARAMELEMENT_H_

#include "CommonElement.h"

namespace HA {
class ParamElement: public HA::CommonElement {
public:
	ParamElement();
	/**
	 * Get the set of names handles by this element.
	 * @return The names to be matched that create elements of this type.
	 */
	inline string* getIds() const {
		return mIds;
	}

	/**
	 * Get the set of names that cause this element to finish.
	 * @return The names of following elements that stop further parse.
	 */
	inline string* getEnds() const {
		return mEnds;
	}

	/**
	 * Allow creating an instance of this node.
	 * @return A new instance of this node.
	 */
	inline ASTNode* newInstance() const {
		return new ParamElement();
	}

	/**
	 * Set new value of name attribute.
	 * @param paramName The new value of name attribute.
	 */
	inline void setParamName(const string& paramName) {
		setAttribute("NAME", paramName);
	}

	/**
	 * Get the value of name attribute.
	 * @return The value of name attribute.
	 */
	inline string getParamName() {
		return getAttribute("NAME");
	}

	/**
	 * Set new value of value attribute.
	 * @param paramValue The new value of value attribute.
	 */
	inline void setParamValue(const string& paramValue) {
		setAttribute("VALUE", paramValue);
	}

	/**
	 * Get the value of value attribute.
	 * @return The value of value attribute.
	 */
	inline string getParamValue() {
		return getAttribute("VALUE");
	}

private:
	static string mIds[];
	static string mEnds[];
};
}
#endif /* PARAMELEMENT_H_ */
